load("@fbsource//tools/build_defs:rust_library.bzl", "rust_library")

oncall("sapling")

rust_library(
    name = "repo",
    srcs = glob(["src/**/*.rs"]),
    autocargo = {"cargo_toml_config": {
        "dependencies_override": {"dependencies": {"sapling-constructors": {"default-features": False}}},
        "extra_buck_dependencies": {"dependencies": ["//eden/scm/lib/revisionstore:revisionstore"]},
        "features": {
            "default": [],
            "fb": [
                "sapling-configloader/fb",
            ],
            "wdir": ["sapling-workingcopy"],
        },
        "lib": {"name": "repo"},
        "package": {
            "authors": ["Meta Source Control Team <sourcecontrol-dev@meta.com>"],
            "homepage": "https://sapling-scm.com/",
            "license": "MIT",
            "name": "sapling-repo",
            "repository": "https://github.com/facebook/sapling",
        },
    }},
    crate_root = "src/lib.rs",
    features = [
        "fb",
        "wdir",
    ],
    test_deps = ["fbsource//third-party/rust:tempfile"],
    deps = [
        "fbsource//third-party/rust:anyhow",
        "fbsource//third-party/rust:fail",
        "fbsource//third-party/rust:fs-err",
        "fbsource//third-party/rust:once_cell",
        "fbsource//third-party/rust:parking_lot",
        "fbsource//third-party/rust:thiserror",
        "fbsource//third-party/rust:tracing",
        "//eden/scm/lib/async-runtime:async-runtime",
        "//eden/scm/lib/commits/trait:commits-trait",
        "//eden/scm/lib/config/loader:configloader",
        "//eden/scm/lib/config/model:configmodel",
        "//eden/scm/lib/constructors:constructors",
        "//eden/scm/lib/eagerepo:eagerepo",
        "//eden/scm/lib/edenapi:edenapi",
        "//eden/scm/lib/identity:identity",
        "//eden/scm/lib/manifest-tree:manifest-tree",
        "//eden/scm/lib/metalog:metalog",
        "//eden/scm/lib/repo/repo-minimal-info:repo-minimal-info",
        "//eden/scm/lib/repo/url:repourl",
        "//eden/scm/lib/repolock:repolock",
        "//eden/scm/lib/revisionstore:revisionstore",
        "//eden/scm/lib/revsets:revsets",
        "//eden/scm/lib/storemodel:storemodel",
        "//eden/scm/lib/treestate:treestate",
        "//eden/scm/lib/types:types",
        "//eden/scm/lib/util:util",
        "//eden/scm/lib/util/factory:factory",
        "//eden/scm/lib/util/rewrite-macros:rewrite-macros",
        "//eden/scm/lib/workingcopy:workingcopy",
    ],
)
